﻿exports.mid_router = function (gzip_mid, json_mid) {
    return function (req, res, next) {
        var contentEncoding = req.headers["content-encoding"];
        if (contentEncoding && contentEncoding == 'gzip') {
            return gzip_mid(req, res, next);
        } else {
            return json_mid(req, res, next);
        }
    }
}